const arr1 = [1, 2, 3, 4, 5]

//! 手写一个map 回调函数
function mymap(arr,callback) {
    let result = []
    for (let i = 0; i < arr.length; i++){
        result.push(callback(arr[i],i,arr))
    }
    return result
}
const last= mymap(arr1, function (nums) {
    nums = nums * 2
    return nums
})
console.log(last);
